home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Source Code / C / Applications / Portable Patmos / usr / include / netiso / tp_trace.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-11-08  |  5.9 KB  |  193 lines  |  [TEXT/R*ch]

  1. /*-
  2.  * Copyright (c) 1991 The Regents of the University of California.
  3.  * All rights reserved.
  4.  *
  5.  * Redistribution and use in source and binary forms, with or without
  6.  * modification, are permitted provided that the following conditions
  7.  * are met:
  8.  * 1. Redistributions of source code must retain the above copyright
  9.  *    notice, this list of conditions and the following disclaimer.
  10.  * 2. Redistributions in binary form must reproduce the above copyright
  11.  *    notice, this list of conditions and the following disclaimer in the
  12.  *    documentation and/or other materials provided with the distribution.
  13.  * 3. All advertising materials mentioning features or use of this software
  14.  *    must display the following acknowledgement:
  15.  *    This product includes software developed by the University of
  16.  *    California, Berkeley and its contributors.
  17.  * 4. Neither the name of the University nor the names of its contributors
  18.  *    may be used to endorse or promote products derived from this software
  19.  *    without specific prior written permission.
  20.  *
  21.  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  22.  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  23.  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  24.  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  25.  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  26.  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  27.  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  28.  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  29.  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  30.  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  31.  * SUCH DAMAGE.
  32.  *
  33.  *    from: @(#)tp_trace.h    7.5 (Berkeley) 6/27/91
  34.  *    $Id: tp_trace.h,v 1.3 1993/05/20 05:28:06 cgd Exp $
  35.  */
  36.  
  37. #ifndef _NETISO_TP_TRACE_H_
  38. #define _NETISO_TP_TRACE_H_
  39.  
  40. /***********************************************************
  41.         Copyright IBM Corporation 1987
  42.  
  43.                       All Rights Reserved
  44.  
  45. Permission to use, copy, modify, and distribute this software and its 
  46. documentation for any purpose and without fee is hereby granted, 
  47. provided that the above copyright notice appear in all copies and that
  48. both that copyright notice and this permission notice appear in 
  49. supporting documentation, and that the name of IBM not be
  50. used in advertising or publicity pertaining to distribution of the
  51. software without specific, written prior permission.  
  52.  
  53. IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
  54. ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
  55. IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
  56. ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
  57. WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
  58. ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
  59. SOFTWARE.
  60.  
  61. ******************************************************************/
  62.  
  63. /*
  64.  * ARGO Project, Computer Sciences Dept., University of Wisconsin - Madison
  65.  */
  66. /* 
  67.  * ARGO TP
  68.  *
  69.  * Definitions needed for the protocol trace mechanism.
  70.  */
  71.  
  72. #define TPPTsendack    1
  73. #define TPPTgotack    2
  74. #define TPPTXack    3
  75. #define TPPTgotXack    4
  76. #define TPPTack        5
  77. #define TPPTindicate    6
  78. #define TPPTusrreq    7
  79. #define TPPTmisc    8
  80. #define TPPTpcb        9
  81. #define TPPTref        10
  82. #define TPPTtpduin    11
  83. #define TPPTparam    12
  84. #define TPPTertpdu    13
  85. #define TPPTdriver    14
  86. #define TPPTtpduout    15
  87.  
  88. #include "../netiso/tp_pcb.h"
  89.  
  90. /* this #if is to avoid lint */
  91.  
  92. #if  defined(TP_TRACEFILE)||!defined(KERNEL)
  93.  
  94. #include "../netiso/tp_tpdu.h"
  95.  
  96. #define TPTRACE_STRLEN 50
  97.  
  98.  
  99. /* for packet tracing */
  100. struct tp_timeval {
  101.     SeqNum    tptv_seq;
  102.     u_int tptv_kind;
  103.     u_int tptv_window;
  104.     u_int tptv_size;
  105. };
  106.  
  107. struct    tp_Trace {
  108.     u_int    tpt_event;
  109.     u_int    tpt_arg;
  110.     u_int     tpt_arg2;
  111.     int    tpt_tseq;
  112.     struct timeval    tpt_time;
  113.     union {
  114.         struct inpcb    tpt_Inpcb; /* protocol control block */
  115.         struct tp_ref     tpt_Ref; /* ref part of pcb */
  116.         struct tpdu     tpt_Tpdu; /* header*/
  117.         struct tp_param tpt_Param; /* ?? bytes, make sure < 128??*/
  118.         struct tp_timeval tpt_Time;
  119.         struct {
  120.             u_int tptm_2;
  121.             u_int tptm_3;
  122.             u_int tptm_4;
  123.             u_int tptm_5;
  124.             char tpt_Str[TPTRACE_STRLEN];
  125.             u_int tptm_1;
  126.         } tptmisc;
  127.         u_char             tpt_Ertpdu; /* use rest of structure */
  128.     } tpt_stuff;
  129. };
  130. #define tpt_inpcb tpt_stuff.tpt_Inpcb
  131. #define tpt_pcb tpt_stuff.tpt_Pcb
  132. #define tpt_ref tpt_stuff.tpt_Ref
  133. #define tpt_tpdu tpt_stuff.tpt_Tpdu
  134. #define tpt_param tpt_stuff.tpt_Param
  135. #define tpt_ertpdu tpt_stuff.tpt_Ertpdu
  136. #define tpt_str tpt_stuff.tptmisc.tpt_Str
  137. #define tpt_m1 tpt_stuff.tptmisc.tptm_1
  138. #define tpt_m2 tpt_stuff.tptmisc.tptm_2
  139. #define tpt_m3 tpt_stuff.tptmisc.tptm_3
  140. #define tpt_m4 tpt_stuff.tptmisc.tptm_4
  141. #define tpt_m5 tpt_stuff.tptmisc.tptm_5
  142.  
  143. #define tpt_seq tpt_stuff.tpt_Time.tptv_seq
  144. #define tpt_kind tpt_stuff.tpt_Time.tptv_kind
  145. #define tpt_window tpt_stuff.tpt_Time.tptv_window
  146. #define tpt_size tpt_stuff.tpt_Time.tptv_size
  147.  
  148. #endif defined(TP_TRACEFILE)||!defined(KERNEL)
  149.  
  150.  
  151. #ifdef TPPT
  152.  
  153. #define TPTRACEN 300
  154.  
  155. #define tptrace(A,B,C,D,E,F) \
  156.     tpTrace((struct tp_pcb *)0,\
  157.     (u_int)(A),(u_int)(B),(u_int)(C),(u_int)(D),(u_int)(E),(u_int)(F))
  158.  
  159. #define tptraceTPCB(A,B,C,D,E,F) \
  160.     tpTrace(tpcb,\
  161.     (u_int)(A),(u_int)(B),(u_int)(C),(u_int)(D),(u_int)(E),(u_int)(F))
  162.  
  163. extern void tpTrace();
  164. extern struct tp_Trace tp_Trace[];
  165. extern u_char    tp_traceflags[];
  166. int tp_Tracen = 0;
  167.  
  168. #define IFTRACE(ascii)\
  169.     if(tp_traceflags[ascii]) {
  170. /* 
  171.  * for some reason lint complains about tp_param being undefined no
  172.  * matter where or how many times I define it.
  173.  */
  174. #define ENDTRACE  }
  175.  
  176.  
  177. #else  TPPT
  178.  
  179. /***********************************************
  180.  * NO TPPT TRACE STUFF
  181.  **********************************************/
  182. #define TPTRACEN 1
  183.  
  184. #define tptrace(A,B,C,D,E,F) 0
  185. #define tptraceTPCB(A,B,C,D,E,F) 0
  186.  
  187. #define IFTRACE(ascii)     if (0) {
  188. #define ENDTRACE     }
  189.  
  190. #endif TPPT
  191.  
  192. #endif /* !_NETISO_TP_TRACE_H_ */
  193.